//1. 引入express
const express = require('express')
//2. 创建应用对象
const app = express()

// 创建路由规则
// request 是对请求报文的封装
// response 是对响应报文的封装
app.get("/user2", (request, response) => {
    let user = [
        {
            name: "tom2",
            age: 20,
        },
        {
            name: "jack2",
            age: 28,
        },
        {
            name: "dana2",
            age: 403,
        },
    ];
    //设置响应
    response.send(user);
});
//4. 监听端口启动服务
app.listen(8001, () => {
    console.log("服务已经启动, 8001 端口监听中....");
});
